The DERIV function performs numerical differentiation using 3-point, Lagrangian interpolation.
This routine is written in the IDL language. Its source code can be found in the file deriv.pro in the lib subdirectory of the IDL distribution.
Result = DERIV([X,] Y)
Returns the derivative of the numerical differentiation.
Differentiate with respect to this variable. If omitted, unit spacing for Y (i.e., Xi = i) is assumed.
The variable to be differentiated.
X = [ 0.1, 0.3, 0.4, 0.7, 0.9]
Y = [ 1.2, 2.3, 3.2, 4.4, 6.6]
PRINT, DERIV(Y)
PRINT, DERIV(X,Y)
IDL prints:
1.20000 1.00000 1.05000 1.70000 2.70000
3.16666 7.83333 7.75000 8.20000 13.8000
Original |
Introduced |